/**
 * 获取GET参数
 * @param {type} name
 * @returns {unresolved}
 */
var getParameter = function(name) {
    var str = window.location.search;
    var index = str.indexOf("?" + name + "=");
    if (index == -1) {
        index = str.indexOf("&" + name + "=");
    }
    if (index == -1) {
        return null;
    }
    var end = str.indexOf("&", index + 1);
    if (end == -1) {
        return str.substring(index + 2 + name.length);
    } else {
        return str.substring(index + 2 + name.length, end);
    }
};